#ifndef BODY_H
#define BODY_H

// #include "bodyarch.h"
// #include "GL/gl.h"
#include <vector>

#include "bodypart.h"
#include "constraint.h"

#include "bodypart_soft_torus.h"
#include "bodypart_rigid_box.h"
#include "bodypart_rigid_sphere.h"
#include "bodypart_rigid_cylinder.h"
#include "bodypart_rigid_trianglemesh.h"

#include "src/filesystem/be_filesystem.h"

// #include "mouth.h"
// #include <cmath>
// #include <iostream>
// #include <sstream>
// #include "btBulletDynamicsCommon.h"

class Body
{
	public:
		Body( void* owner, boost::shared_ptr<btDynamicsWorld> ownerWorld );
		virtual ~Body();


		//BodypartSoftTorus*		addBodyPart_Soft_Torus(const btVector3& s, btSoftBodyWorldInfo& softbodyInfo, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr);
		boost::shared_ptr<BodypartRigidBox>	addBodyPart_Rigid_Box(const btVector3& dimensions, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr, float lin_damping, float ang_damping);
		//BodypartRigidSphere*		addBodyPart_Rigid_Sphere(float radius, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr, float lin_damping, float ang_damping);
		//BodypartRigidCylinder*	addBodyPart_Rigid_Cylinder(const btVector3& dimensions, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr, float lin_damping, float ang_damping);
		boost::shared_ptr<BodypartRigidTrianglemesh>	addBodyPart_Rigid_Trianglemesh(btVector3* gVertices, unsigned int numVertices, int* gVIndices, unsigned int numVIndices, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr, float lin_damping, float ang_damping);
		boost::shared_ptr<BodypartRigidTrianglemesh>	addBodyPart_Rigid_Trianglemesh(boost::shared_ptr<Model> model, const btVector3& scale, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr, float lin_damping, float ang_damping);

		//vector<Constraint*>	constraints;
		//void			addConstraint(unsigned int bodypartID1, unsigned int bodypartID2, const btTransform& localA, const btTransform& localB, double limitA, double limitB);

		boost::shared_ptr<btDynamicsWorld> 	m_ownerWorld;
		void*			m_owner;
		std::vector<boost::shared_ptr<Bodypart> >	m_bodyparts;
		float			m_totalWeight;
	private:
};
#endif
